

def binary_search(number_list, target):
    left = 0
    right = len(number_list)
    # len(number_list) - 1
    while left <= right:
        mid = int((right + left) / 2)
        if number_list[mid] == target:
            return mid
        elif number_list[mid] < target:
            left = mid + 1
        else:
            right = mid - 1






# number_list = [1,3,5,6,9]
# print(binary_search(number_list,9))

def baoli(number_list,target):
    for index, i in enumerate(number_list):
        if i == target:
            return index


number_list = [1,3,5,6,9]
print(baoli(number_list,9))